package com.itheima.Method;

import java.util.Scanner;

public class Method03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入n");
        int a = sc.nextInt();
        System.out.println("请输入m");
        int b = sc.nextInt();
        print(a, b);

    }

    public static void print(int n, int m) {
        int max = getMax(n, m);
        System.out.println("较大值为" + max);
        if (n > m) {
            System.out.println("您的输入有误");return ;

        } else {
            System.out.println(n + "到" + m + "之间的奇数有");
            for (int i = n; i <= m; i++) {
                if (i % 2 == 1) {
                    System.out.println(i);
                }


            }

        }
    }

    public static int getMax(int i, int j) {

        if (i > j) {
            return i;
        } else {
            return j;
        }

    }

}
